/**
 * Copyright 2015-2016 com.eyaomall
 * All rights reserved.
 *
 * @project
 * @author pro
 * @version 1.0
 * @date 2016-03-07
 */
package com.eyaomall.wxmall.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.eyaomall.wxmall.model.po.Member;
import com.lycheeframework.core.annotation.NameSpace;
import com.lycheeframework.core.cmp.kit.IHTTPObject;
import com.lycheeframework.core.cmp.kit.Pages;
import com.lycheeframework.core.support.DaoSupport;

/**
 * 注册会员Dao
 * @author pro
 *
 */
@Repository
@NameSpace("member")
public class MemberDao extends DaoSupport<Member> {

	public Member query(Member member){
		
		return (Member) super.query(member);
	}
	
	/**
	 * 分页查询注册会员
	 * @param member
	 * @param httpObject
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public Pages<List<Member>> page(Member member,IHTTPObject httpObject){
		
		return (Pages<List<Member>>) super.page(member, httpObject);
	}
	
	/**
	 * 修改注册会员数
	 * @param member
	 * @return
	 */
	public boolean update(Member member){
		
		return super.update(member) > 0 ? true : false;
	}
	
	/**
	 * 根据ID删除注册会员ID
	 * @param id
	 * @return
	 */
	public boolean delete(Integer id){
		Member member = new Member();
		member.setId(id);
		member.setIsDeleted("y");
		
		return update(member);
	}
}
